<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        
    </style>
</head>
<body>
    
</body>
<script>

    class Model{
        data1(){
            return "hello";
        }
        data2(){
            return "world";
        }
        data3(){
            return "hahhah";
        }
        data4(){
            return "heihieheihei";
        }
    }

    class View{
        view1(data){
            console.log(data)
        }
        view2(data){
            alert(data)
        }
    }

    class Control{
        constructor(){
            this.m = new Model();
            this.v = new View();
        }
        ctrl1(){
            const d = this.m.data1();
            this.v.view1(d);
        }
        ctrl2(){
            const d = this.m.data2();
            this.v.view1(d);
        }
        ctrl3(){
            const d = this.m.data3();
            this.v.view2(d);
        }
        ctrl4(){
            const d = this.m.data1();
            this.v.view2(d);
        }
    }

    const c = new Control();
    c.ctrl1();
    c.ctrl2();
    c.ctrl3();
    c.ctrl4();
    
    
</script>
</html>